package com.wzs.learn.service;

import com.wzs.learn.bean.Dept;
import com.wzs.learn.factory.DeptClientServiceFallBackFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

//@FeignClient(value = "WZS-SCMS-Hystrix-Dept",fallbackFactory = DeptClientServiceFallBackFactory.class)  //测试dashbord
@FeignClient(value = "WZS-SCMS-Dept",fallbackFactory = DeptClientServiceFallBackFactory.class)
public interface DeptClientService {
    @RequestMapping(value="/dept/add", method= RequestMethod.POST)
    public boolean add(Dept dept);

    @RequestMapping(value="/dept/get/{deptNo}", method=RequestMethod.GET)
    public Dept get(@PathVariable("deptNo") Integer deptNo);

    @RequestMapping(value="/dept/get/all", method=RequestMethod.GET)
    public List<Dept> getAll();

}
